import axios from 'axios'

const classes = {
    //获取所有班级
    getClasses(pageSize, currentPage) {
        return axios({
            url: "/classes/getClasses",
            method: 'GET',
            params: {
                pageSize: pageSize,
                currentPage: currentPage
            }
        })
    },
    //根据subjectId获取对应的班级
    getClassesBySubjectsId(subjectId) {
        return axios({
            url: "/classes/getClassesBySubjectsId",
            method: 'GET',
            params: { subjectsId: subjectId }
        })
    },
    //新增班级
    addClasses(classesName, subjectsId) {
        return axios({
            url: '/classes/addClasses',
            method: 'POST',
            data: {
                name: classesName,
                subjectsId: subjectsId
            }
        })
    },
    //删除班级
    delClasses(classesId) {
        return axios({
            url: '/classes/deleteClasses',
            method: 'DELETE',
            data: {
                _id: classesId
            }
        })
    }
}

export default classes;